
enum SIZE {
    //% block="29*29"
    1,
    //% block="58*58"
    2
}

enum LINE {
    //% block="1"
    1,
    //% block="2"
    2,
    //% block="3"
    3,
    //% block="4"
    4
}



//% color="#3399FF" iconWidth=50 iconHeight=40
namespace dht11_Hum_Temp {
    //% block="读取引脚[PINX]DHT11[Temp]" blockType="reporter"
    //% PINX.shadow="dropdown" PINX.options="PINX" PINX.defl="3"
    //% Temp.shadow="dropdown" Temp.options="Temp" Temp.defl="Temperature"
    export function set_dht11(parameter: any, block: any) {
        let p = parameter.PINX.code
        let t = parameter.Temp.code
         Generator.addInclude("dht11", "#include <dht11.h>")
        Generator.addObject(`dht11`, `dht11`, `DHT11;`);
        Generator.addSetup("dht11",` DHT11.read(${p}); `);
        Generator.addCode(`(float)DHT11.${t}`);

    }



}
